package tech.xs.auth.init;

import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import tech.xs.auth.service.AuthPathPermissionService;
import tech.xs.auth.service.AuthPathRoleService;
import tech.xs.auth.service.AuthPathService;
import tech.xs.auth.service.AuthPathWhiteService;
import tech.xs.common.framework.init.InitExecute;

import javax.annotation.Resource;

@Slf4j
@Component
@Order(10000)
public class AuthInitData implements InitExecute {

    @Resource
    private AuthPathService authPathService;

    @Override
    public void execute() throws Exception {
        log.info("开始加载uri授权缓存");
        authPathService.reloadAllAuthPathCache();
        log.info("uri授权缓存加载完毕");
    }

    @Override
    public boolean isErrorStop() {
        return true;
    }
}
